<template>
  <div id="app">
    <div v-wechat-title="$route.meta.title"></div>
    <router-view></router-view>
  </div>
</template>

<script>
import { oauth } from "@/api/api";
export default {
  name: 'app',
  data () {
    return{}
  },
  created () {
    this.getOauth()
  },
  methods: {
    getOauth(){
      var dataJson = {
        url: window.location.href
      }
      oauth(dataJson).then((res) => {
        if(res.data.code==200){
          if(res.data.data.list){
            location.href=res.data.data.list+"?url="+res.data.data.url
          }else{
            location.href=res.data.data.url
          }
        }
      }).catch((err) => {
        console.dir(err)
      })
    },    
  }
}
</script>

<style>
</style>
